<?php if (!defined('THINK_PATH')) exit();?><style>
	table tr td {
		text-align:center;
	}
</style>
<form class="form-search" action="" method="post" onsubmit="reload();return false;">
	<a class="btn btn-info" onclick="blacklistAdd()">添加黑名单</a>
	 手机号:<input type="text" name="mobile"/><input type="submit" class="btn" value="搜索"/>

</form>
<table class="table table-bordered table-hover">
	<thead><tr><td><input type="checkbox"/></td><td>记录编号</td><td>姓名</td><td>手机号</td><td>创建时间</td><td>备注</td><td>操作</td></tr></thead>
	<tbody>
		<?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr id="blacklist_<?php echo ($vo["id"]); ?>"><td><input type="checkbox"/></td><td><?php echo ($vo["id"]); ?></td><td><?php echo ($vo["name"]); ?></td><td><?php echo ($vo["mobile"]); ?></td><td><?php echo ($vo["create_time"]); ?></td><td><?php echo ($vo["remark"]); ?></td><td width=120>
		<span class="label label-important" style="cursor:pointer" onclick="removeBlacklist(<?php echo ($vo["id"]); ?>)">移除黑名单</span>
		<!--<span class="label label-success" style="cursor:pointer;margin-left:5px" onclick="exportPhone(<?php echo ($vo["inbox_id"]); ?>)">导出</span></td>--></tr><?php endforeach; endif; else: echo "" ;endif; ?>
	</tbody>
</table>
<div class="pagination" style="float:right">
	<?php echo ($page); ?>
</div>
<script>
	$(function(){
		$("#datetimepicker-start").datetimepicker({format:"yyyy-MM-dd"});
		$("#datetimepicker-end").datetimepicker({format:"yyyy-MM-dd"});
	});
	
	function reload(){
		$("#maincontent").load('__APP__/Contacts/blacklist',{startdate:getInputValueByName('startdate'),enddate:getInputValueByName('enddate'),mobile:getInputValueByName('mobile')});
	}
	function removeBlacklist($id){
		$.getJSON("__APP__/Contacts/removeBlacklist",{id:$id},function(json){
			if(json.status == 1){
				$("#blacklist_"+$id).remove();
			}else{
				$.warn("系统提示","移除失败");
			}
		});
	}
	function blacklistAdd(){
		$.dialog("添加黑名单","__APP__/Contacts/blacklistAdd");
	}
</script>